/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.itschapala.dsw2.modelo;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author User
 */
@Entity
@Table(name = "eventos")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Eventos.findAll", query = "SELECT e FROM Eventos e"),
    @NamedQuery(name = "Eventos.findByIdEventos", query = "SELECT e FROM Eventos e WHERE e.idEventos = :idEventos"),
    @NamedQuery(name = "Eventos.findByEvent", query = "SELECT e FROM Eventos e WHERE e.event = :event"),
    @NamedQuery(name = "Eventos.findByDate", query = "SELECT e FROM Eventos e WHERE e.date = :date"),
    @NamedQuery(name = "Eventos.findByTime", query = "SELECT e FROM Eventos e WHERE e.time = :time"),
    @NamedQuery(name = "Eventos.findByLocation", query = "SELECT e FROM Eventos e WHERE e.location = :location"),
 @NamedQuery(name = "Eventos.findDuplicity", query = "SELECT e FROM Eventos e WHERE e.event = :event")
})
public class Eventos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idEventos")
    private Integer idEventos;
    @Size(max = 45)
    @Column(name = "Event")
    private String event;
    @Size(max = 45)
    @Column(name = "Date")
    private String date;
    @Size(max = 45)
    @Column(name = "Time")
    private String time;
    @Size(max = 45)
    @Column(name = "Location")
    private String location;
    @OneToMany(mappedBy = "eventosidEventos")
    private List<Confirmacion> confirmacionList;
    @JoinColumn(name = "Register_idRegister", referencedColumnName = "idRegister")
    @ManyToOne
    private Register registeridRegister;

    public Eventos() {
    }

    public Eventos(Integer idEventos) {
        this.idEventos = idEventos;
    }

    public Integer getIdEventos() {
        return idEventos;
    }

    public void setIdEventos(Integer idEventos) {
        this.idEventos = idEventos;
    }

    public String getEvent() {
        return event;
    }

    public void setEvent(String event) {
        this.event = event;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    @XmlTransient
    public List<Confirmacion> getConfirmacionList() {
        return confirmacionList;
    }

    public void setConfirmacionList(List<Confirmacion> confirmacionList) {
        this.confirmacionList = confirmacionList;
    }

    public Register getRegisteridRegister() {
        return registeridRegister;
    }

    public void setRegisteridRegister(Register registeridRegister) {
        this.registeridRegister = registeridRegister;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idEventos != null ? idEventos.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Eventos)) {
            return false;
        }
        Eventos other = (Eventos) object;
        if ((this.idEventos == null && other.idEventos != null) || (this.idEventos != null && !this.idEventos.equals(other.idEventos))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "mx.itschapala.dsw2.modelo.Eventos[ idEventos=" + idEventos + " ]";
    }
    
}
